#!/bin/bash
commandSelf=$(readlink "$0");
if [ -z "${commandSelf}" ] ; then commandSelf="$0"; fi
commandDir=$(dirname "${commandSelf}");
toolsRoot=$(cd "${commandDir}"; pwd;);
if [ "${toolsRoot}" != "/" ] ; then toolsRoot="${toolsRoot}/"; fi
projectRoot=$(cd "${toolsRoot}../../../"; pwd;);
if [ "${projectRoot}" != "/" ] ; then projectRoot="${projectRoot}/"; fi
logsDir=$(cd "${projectRoot}/Data/Logs/"; pwd;);
if [ "${logsDir}" != "/" ] ; then logsDir="${logsDir}/"; fi
fileList=$(ls -l "${logsDir}" |grep '^-'|awk '{print $9}';);
for file in ${fileList}
do
  filePath=${logsDir}${file};
  if [ -e "${filePath}" ]
  then
    cat /dev/null>${filePath};
    echo "${file} is empty";
  else
    echo "${filePath} ist not exist";
  fi
done
echo "clear log finish";
exit;
